package cn.mifengkong.appcommon.webview.jshandler;

import com.mifengkong.frtools.jsbridge.BridgeHandler;
import com.mifengkong.frtools.jsbridge.CallBackFunction;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by jiangyongxing on 2018/6/13.
 * 描述：
 */

public class DefaultHandler implements BridgeHandler {

    @Override
    public void handler(String data, CallBackFunction function) {
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put("status", 0);
            jsonObject.put("code", "00001");
            jsonObject.put("msg", "no frbridge function!");
            JSONObject dataJo = new JSONObject();
            jsonObject.putOpt("data", dataJo);
            String jsonString = jsonObject.toString();
            function.onCallBack(jsonString);


        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

}
